//
//  YBBaseCell.m
//  YanzhouCloud
//
//  Created by Cocoa on 2019/7/1.
//  Copyright © 2019 yibai. All rights reserved.
//

#import "YBBaseCell.h"

@implementation YBBaseCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self base_setupUI];
    }
    return self;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self base_setupUI];
}
- (void)base_setupUI {
//    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.pContentView = [[UIView alloc] initWithFrame:self.bounds];
    [self.contentView addSubview:self.pContentView];
    [self.pContentView mas_makeConstraints:^(MASConstraintMaker *make) {

//        make.edges.equalTo(self.contentView);
        make.left.top.right.mas_offset(0);
        make.bottom.mas_offset(-1);
    }];
    self.pContentView.backgroundColor = UIColor.whiteColor;
    
    self.contentView.backgroundColor = global_viewBackgroundColor;
//    self.showRound = YES;
//    self.showShadow = YES;
    
    
}
//- (void)setShowShadow:(BOOL)showShadow {
//    if (_showShadow == showShadow) {
//        return;
//    }
//    _showShadow = showShadow;
//
//    self.pContentView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.04].CGColor;
//    self.pContentView.layer.shadowOffset = CGSizeMake(0,1);
//    self.pContentView.layer.shadowOpacity = 1;
//    self.pContentView.layer.shadowRadius = 2;
//
//}
//- (void)setShowRound:(BOOL)showRound {
//    if (_showRound == showRound) {
//        return;
//    }
//    _showRound = showRound;
//
//    self.pContentView.layer.cornerRadius = showRound ? 3.0f : 0.0f;
//    self.pContentView.layer.masksToBounds = YES;
//}

- (void)drawRect:(CGRect)rect {
    if(_showBottomLine == YES)
    {
        
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextSetLineWidth(context, 1.f);
        //    CGContextSetStrokeColorWithColor(context, UIColor.k_hexColor(0xe0e0e0).CGColor);
        //    CGContextSetFillColorWithColor(context, UIColor.k_hexColor(0xe0e0e0).CGColor);
        //    CGContextFillRect(context, rect);
        
        CGContextSetStrokeColorWithColor(context, global_view_darkLineColor.CGColor);
        CGContextMoveToPoint(context, 15, rect.size.height);
        CGContextAddLineToPoint(context, rect.size.width, rect.size.height);
        
        CGContextStrokePath(context);
    }
}

@end
